package com.pylc.model.dao;

import com.pylc.common.bean.Pager;
import org.hibernate.criterion.DetachedCriteria;

import java.io.Serializable;
import java.util.List;

/**
 * @author Lindsey
 */
public interface BaseDao<T, PK extends Serializable> {


    public T get(PK id);


    public T load(PK id);


    public List<T> get(PK[] ids);


    public T get(String propertyName, Object value);


    public List<T> getList(String propertyName, Object value);


    public List<T> getAll();

    public List<T> findByPager(Pager pager);

    public List<T> findByPager(Pager pager, DetachedCriteria detachedCriteria);

    public Long getTotalCount();

    public boolean isUnique(String propertyName, Object value);

    public boolean isExist(String propertyName, Object value);

    public PK save(T entity);

    public void update(T entity);

    public void delete(T entity);

    public void delete(PK id);

    public void delete(PK[] ids);

    public void flush();

    public void clear();

    public void evict(Object object);
}